<?php
class MedSocFace300x250 extends WP_Widget {

	function __construct(){
		parent::__construct('media-face-300x250', 'Aves PT Media Social FB 300x250', array('description' => 'Bloco do Face Book 300x250.'));
	}

	/* display widget */
	function widget($args, $instance) {
		extract($args, EXTR_SKIP);
		do_vertical_space ('10');
		?>
	<!-- Código referente ao Facebook -->
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
		var js, fjs = d.getElementsByTagName(s)[0];
		if (d.getElementById(id)) return;
		js = d.createElement(s); js.id = id;
		js.src = "//connect.facebook.net/pt_PT/all.js#xfbml=1";
		fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>		
		<div id="fb-300x400">
			<span class="pub-retranca">FACABOOK</span>
			<div class="fb-300x400">
				<div class="fb-like-box" data-href="https://www.facebook.com/Avespt" data-width="300" data-height="400" data-show-faces="true" data-stream="false" data-header="false"></div>
			</div>
		</div>
		<?php
	}
	
	/* update/save function */
	function update($new_instance, $old_instance) {
		$instance = $old_instance;
		$instance['title'] = strip_tags($new_instance['title']);
		return $instance;
	}
	
	/* admin control form */	
	function form($instance) {
		$default = 	array( 'title' => __('Aves PT Media Social FB 300x250') );
		$instance = wp_parse_args( (array) $instance, $default );		
		$field_id = $this->get_field_id('title');
		$field_name = $this->get_field_name('title');
	}
}
?>